home *** CD-ROM | disk | FTP | other *** search
- #!/sbin/sh
- #
- # Install a FLEXlm license
- #
- # This file should be installed nohist and executed in an postop
- # to install a FLEXlm license entry
- #
- ##########################################################################
- # Customomize the following area for the license
- ##########################################################################
-
- FEATURE="Impressario"
- DAEMON="sgifd"
- VERSION="2.000"
- EXPIRATION="01-jan-0"
- NUMLICENSES="0"
- PASSWORD="00000000000000000000"
- VENDORINFO="Impressario"
- ISSUER="Silicon Graphics, Inc."
-
- # Comment the first line and uncomment the next two after it if this
- # license is intended for only one host
- #HOSTID="ANY"
- SYSINFO=`/etc/sysinfo -s`
- HOSTID=`echo $SYSINFO 16o p | dc`
-
- LICENSEDIR="/var/flexlm"
- LICENSEFILE="license.dat"
-
- ##########################################################################
- # The following remains the same for all licenses
- ##########################################################################
-
- # Use the following pattern to confirm that the license lines already exists
-
- SEARCHLINE="FEATURE $FEATURE $DAEMON $VERSION"
-
- if test -r "$LICENSEDIR/$LICENSEFILE"
- then
- if grep "$SEARCHLINE" "$LICENSEDIR/$LICENSEFILE" > /dev/null
- then
- # license line exists, nothing further to do
- exit 0
- else
- # Need to add license to existing file
- if test -w "$LICENSEDIR/$LICENSEFILE"
- then
- true
- else
- echo "No permission to write to $LICENSEDIR/$LICENSEFILE" 1>&2
- exit 1
- fi
- fi
- else
- # create the directory if needed
-
- if test -d "$LICENSEDIR"
- then
- true
- else
- if mkdir -p "$LICENSEDIR"
- then
- true
- else
- exit 1
- fi
- fi
-
- # try to create the file
-
- if touch "$LICENSEDIR/$LICENSEFILE"
- then
- true
- else
- exit 1
- fi
- fi
-
- # Add the license lines
-
- echo "FEATURE $FEATURE $DAEMON $VERSION $EXPIRATION $NUMLICENSES $PASSWORD HOSTID=$HOSTID \\" >> "$LICENSEDIR/$LICENSEFILE"
- echo "\tvendor_info=\"$VENDORINFO\" \\" >> "$LICENSEDIR/$LICENSEFILE"
- echo "\tISSUER=\"$ISSUER\"" >> "$LICENSEDIR/$LICENSEFILE"
- echo >> "$LICENSEDIR/$LICENSEFILE"
-
- exit 0
-